<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<link href="<s:url value="/css/main.css"/>" rel="stylesheet" type="text/css"/>
	<title><s:text name="application.title"/></title>
</head>
<body>

<s:actionerror/>

<div class="titleDiv"><s:text name="application.title"/></div>

<h1><s:text name="label.studentSubjects.listSubjects"/> <s:property value="student.Nombre"/> (<s:property value="student.Dni"/>)</h1>

<s:url action="studentAction!doListEnrollment"  id="enroll" escapeAmp="false">
</s:url>
<a href="<s:property value="#enroll"/>"><s:text name="label.studentmatric.button"/></a>

<s:url action="subjectAction!doListMarks"  id="listMarks" escapeAmp="false">
	<s:param name="studentID" value="student.Dni"/>
</s:url>
<a href="<s:property value="#listMarks"/>"><s:text name="label.studentnotas.button"/></a>

<s:url action="loginAction!doLogout"  id="logout" escapeAmp="false">
</s:url>
<a href="<s:property value="#logout"/>"><s:text name="label.logout.button"/></a>
	

<table class="borderAll">
		    <tr>
		        <th><s:text name="label.lecturerSubject.code"/></th>
		        <th><s:text name="label.lecturerSubject.namesub"/></th>
		        <th><s:text name="label.lecturerSubject.credits"/></th>
		        <th><s:text name="label.lecturerSubject.teacher"/></th>
		        <th><s:text name="label.lecturerSubject.list"/></th>
		        <th><s:text name="label.lecturerSubject.noStudents"/></th>
		        <th>&nbsp;&nbsp;</th>
		    </tr>
		    <s:iterator value="subjectsList" status="status">
		        <tr class="<s:if test="#status.even">even</s:if><s:else>odd</s:else>">
		            <td class="nowrap"><s:property value="%{ codigo }"/></td>
		            <td class="nowrap"><s:property value="%{ nombre }"/></td>
		            <td class="nowrap"><s:property value="%{ creditos }"/></td>
		            <td class="nowrap"><s:property value="profesor.nombre"/></td>
		            <td class="nowrap">
			            <s:url action="subjectAction!listUnitsStudent"  id="units" escapeAmp="false">
		            		<s:param name="subjectID" value="%{ Id }"/>
						</s:url>
						<a href="<s:property value="#units"/>"><s:text name="%{ unidades.size }"/></a></td>
		            <td class="nowrap"><s:property value="matriculacion.size"/></td>
		            
		            <s:url action="studentAction!unEnroll"  id="unenroll" escapeAmp="false">
		            	<s:param name="subjectID" value="%{ id }"/>
					</s:url>
					<td class="nowrap"><a href="<s:property value="#unenroll"/>"><s:text name="label.studentdesmatric.button"/></a></td>
					
					<s:url action="subjectAction!doListMarksSubject"  id="marks" escapeAmp="false">
						<s:param name="subjectID" value="%{ id }"/>			
						<s:param name="studentID" value="student.dni"/>	
					</s:url>
					<td class="nowrap"><a href="<s:property value="#marks"/>"><s:text name="label.studentnotasasig.button"/></a></td>
		        </tr>
			</s:iterator>	
	</table>
		
</body>
</html>